1 /* 2 * This file is part of gtkD. 3 * 4 * gtkD is free software; you can redistribute it and/or modify 5 * it under the terms of the GNU Lesser General Public License 6 * as published by the Free Software Foundation; either version 3 7 * of the License, or (at your option) any later version, with 8 * some exceptions, please read the COPYING file. 9 * 10 * gtkD is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNU Lesser General Public License for more details. 14 * 15 * You should have received a copy of the GNU Lesser General Public License 16 * along with gtkD; if not, write to the Free Software 17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA 18 */ 19 20 // generated automatically - do not change 21 // find conversion definition on APILookup.txt 22 // implement new conversion functionalities on the wrap.utils pakage 23 24 25 module sourceview.RegionIter; 26 27 private import glib.MemorySlice; 28 private import gobject.ObjectG; 29 private import gtk.TextIter; 30 private import sourceview.c.functions; 31 public import sourceview.c.types; 32 33 34 /** 35 * An opaque datatype. 36 * 37 * Ignore all its fields and initialize the iter with [method@Region.get_start_region_iter]. 38 */ 39 public class RegionIter 40 { 41 /** the main Gtk struct */ 42 protected GtkSourceRegionIter* gtkSourceRegionIter; 43 protected bool ownedRef; 44 45 /** Get the main Gtk struct */ 46 public GtkSourceRegionIter* getRegionIterStruct(bool transferOwnership = false) 47 { 48 if (transferOwnership) 49 ownedRef = false; 50 return gtkSourceRegionIter; 51 } 52 53 /** the main Gtk struct as a void* */ 54 protected void* getStruct() 55 { 56 return cast(void*)gtkSourceRegionIter; 57 } 58 59 /** 60 * Sets our main struct and passes it to the parent class. 61 */ 62 public this (GtkSourceRegionIter* gtkSourceRegionIter, bool ownedRef = false) 63 { 64 this.gtkSourceRegionIter = gtkSourceRegionIter; 65 this.ownedRef = ownedRef; 66 } 67 68 69 /** 70 * Gets the subregion at this iterator. 71 * 72 * Params: 73 * start = iterator to initialize with the subregion start, or %NULL. 74 * end = iterator to initialize with the subregion end, or %NULL. 75 * 76 * Returns: %TRUE if @start and @end have been set successfully (if non-%NULL), 77 * or %FALSE if @iter is the end iterator or if the region is empty. 78 */ 79 public bool getSubregion(out TextIter start, out TextIter end) 80 { 81 GtkTextIter* outstart = sliceNew!GtkTextIter(); 82 GtkTextIter* outend = sliceNew!GtkTextIter(); 83 84 auto __p = gtk_source_region_iter_get_subregion(gtkSourceRegionIter, outstart, outend) != 0; 85 86 start = ObjectG.getDObject!(TextIter)(outstart, true); 87 end = ObjectG.getDObject!(TextIter)(outend, true); 88 89 return __p; 90 } 91 92 /** 93 * Returns: whether @iter is the end iterator. 94 */ 95 public bool isEnd() 96 { 97 return gtk_source_region_iter_is_end(gtkSourceRegionIter) != 0; 98 } 99 100 /** 101 * Moves @iter to the next subregion. 102 * 103 * Returns: %TRUE if @iter moved and is dereferenceable, or %FALSE if @iter has 104 * been set to the end iterator. 105 */ 106 public bool next() 107 { 108 return gtk_source_region_iter_next(gtkSourceRegionIter) != 0; 109 } 110 }